class Animal(object):
    def __init__(self,name,age):
        """
        __init__初始化方法，在实例化对象的时候，自动调用
        """
        self.name = name
        self.age = age
        print("我是动物")

    def eat(self,food):
        print(f"正在{food}")

    def play(self):
        print(f"{self.name}今年{self.age}正在玩耍")

    def sleep(self):
        print("正在睡觉")

dog = Animal("泰迪",10)
dog.gender = "男"
print(dir(dog))
print(dog.gender)

# dog.play()
#
pig = Animal("小猪佩奇",5)
print(dir(pig))
print(pig.gender)
# pig.play()
